package com.ebt.m.customer.model;

import com.ebt.m.customer.listener.ICustomer;
import com.ebt.m.customer.util.PinyinUtil;
import com.ebt.m.utils.SortKeyUtil;

import java.io.Serializable;

public class CustomerModel implements ICustomer,Serializable{

	public String portraitPath;
	
	public String uuid;//CustomerUUid
	
	public String name;
	
	public String sortKeyString;
	
	public String importContact;
	
	public Long lastActiveTime;
	
	public char sortKeyChar = '#';
	/**
	 * classifiedSortKey长度为3，其中：
	 * 		classifiedSortKey[0] == 测试
	 * 		classifiedSortKey[1] == CESHI
	 * 		classifiedSortKey[2] == CS
	 */
	public String[] classifiedSortKey;

	public CustomerModel(String uuid, String name, String sortKeyString, String importContact, Long lastActiveTime){
		this.uuid = uuid;
		this.name = name;
		this.sortKeyString = sortKeyString;
		this.importContact = importContact;
		this.sortKeyChar = PinyinUtil.getSortKeyChar(sortKeyString);
		this.lastActiveTime = lastActiveTime;
		this.classifiedSortKey = SortKeyUtil.classifySortKey(sortKeyString, null);
	}

	public CustomerModel(String uuid, String name, String sortKeyString, String importContact, Long lastActiveTime, String portraitPath){
		this.uuid = uuid;
		this.name = name;
		this.sortKeyString = sortKeyString;
		this.importContact = importContact;
		this.sortKeyChar = PinyinUtil.getSortKeyChar(sortKeyString);
		this.lastActiveTime = lastActiveTime;
		this.portraitPath = portraitPath;
		this.classifiedSortKey = SortKeyUtil.classifySortKey(sortKeyString, null);
	}
	
	public CustomerModel(String uuid, String name, String sortKeyString, char sortKeyChar, String importContact, Long lastActiveTime, String portraitPath){
		this.uuid = uuid;
		this.name = name;
		this.sortKeyString = sortKeyString;
		this.sortKeyChar = sortKeyChar;
		this.importContact = importContact;
		this.lastActiveTime = lastActiveTime;
		this.portraitPath = portraitPath;
		this.classifiedSortKey = SortKeyUtil.classifySortKey(sortKeyString, null);
	}

	@Override
	public String getCustomerUuid() {
		return uuid;
	}
}